﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Chart3D;
using PGMHelper;

namespace WSAP
{
    /// <summary>
    /// 结构绘图数据
    /// </summary>
    public class StructrueChart
    {
        /// <summary>
        /// 模型数据
        /// </summary>
        private WModelNet Model { set; get; }

        /// <summary>
        /// 绘图对象
        /// </summary>
        private Chart3DMain chart3D { set; get; }

        /// <summary>
        /// 变形最大值与结构最大尺度的比值
        /// </summary>
        public static double MaxDeformToMaxDimention = 0.2;

        /// <summary>
        /// 框架变形三次样条插值点数目
        /// </summary>
        public static int FrameInterpolationPrtNum = 5;

        /// <summary>
        /// 绘图的模态
        /// </summary>
        public static int ModeID = 3;

        /// <summary>
        /// 绘图
        /// </summary>
        /// <param name="elevation"></param>
        /// <param name="azimuth"></param>
        public void ToGraphics(int elevation, int azimuth)
        {
            //绘图
            this.chart3D.ToGraphics(elevation, azimuth, isAixsToG: false);
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="directPath"></param>
        public StructrueChart(WModelNet model, Control control, StructrueChartParam param)
        {
            //获得模型
            this.Model = model;
            //构造绘图数据
            this.chart3D = this.Model.GetChart3D(control, param);
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="directPath"></param>
        public StructrueChart(WModelNet model, Control control)
        {
            //获得模型
            this.Model = model;
            //构造绘图数据
            this.chart3D = this.Model.GetChart3D(control, new StructrueChartParam(StructureChartType.SlabOnly));
        }

        /// <summary>
        /// 楼板响应绘图
        /// </summary>
        /// <param name="slab"></param>
        /// <param name="control"></param>
        public StructrueChart(WSlabBuilderNet slab, Control control, SlabChartParam param)
        {
            //构造绘图数据
            this.chart3D = slab.GetSlabChart3D(control, param);
        }
    }
}
